# Based on https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/deploy/vpa-v1-crd-gen.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    api-approved.kubernetes.io: https://github.com/kubernetes/kubernetes/pull/63797
    controller-gen.kubebuilder.io/version: v0.4.0
  creationTimestamp: null
  name: verticalpodautoscalers.autoscaling.k8s.io
  labels:
    heritage: deckhouse
    module: vertical-pod-autoscaler-crd
spec:
  group: autoscaling.k8s.io
  scope: Namespaced
  names:
    plural: verticalpodautoscalers
    singular: verticalpodautoscaler
    kind: VerticalPodAutoscaler
    shortNames:
    - vpa
  versions:
  - additionalPrinterColumns:
    - jsonPath: .spec.updatePolicy.updateMode
      name: Mode
      type: string
    - jsonPath: .status.recommendation.containerRecommendations[0].target.cpu
      name: CPU
      type: string
    - jsonPath: .status.recommendation.containerRecommendations[0].target.memory
      name: Mem
      type: string
    - jsonPath: .status.conditions[?(@.type=='RecommendationProvided')].status
      name: Provided
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1
    schema:
      openAPIV3Schema: &schema
        description: VerticalPodAutoscaler is the configuration for a vertical Pod
          autoscaler, which automatically manages Pod resources based on historical
          and real time resource utilization.
        properties:
          spec:
            properties:
              resourcePolicy:
                description: Controls how the autoscaler computes recommended resources.
                  The resource policy may be used to set constraints on the recommendations
                  for individual containers. If not specified, the autoscaler computes
                  recommended resources for all containers in the pod, without additional
                  constraints.
                properties:
                  containerPolicies:
                    description: Per-container resource policies.
                    items:
                      description: ContainerResourcePolicy controls how autoscaler
                        computes the recommended resources for a specific container.
                      properties:
                        containerName:
                          description: Name of the container or DefaultContainerResourcePolicy,
                            in which case the policy is used by the containers that
                            don't have their own policy specified.
                          type: string
                        controlledResources:
                          description: Specifies the type of recommendations that
                            will be computed (and possibly applied) by VPA.
                          items:
                            description: ResourceName is the name identifying various
                              resources in a ResourceList.
                            type: string
                          type: array
                          x-doc-default: ['ResourceCPU', 'ResourceMemory']
                        controlledValues:
                          description: Specifies which resource values should be controlled.
                          enum:
                          - RequestsAndLimits
                          - RequestsOnly
                          type: string
                          x-doc-default: 'RequestsAndLimits'
                        maxAllowed:
                          additionalProperties:
                            anyOf:
                            - type: integer
                            - type: string
                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                            x-kubernetes-int-or-string: true
                          description: Specifies the maximum amount of resources that
                            will be recommended for the container. The default is
                            no maximum.
                          type: object
                        minAllowed:
                          additionalProperties:
                            anyOf:
                            - type: integer
                            - type: string
                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                            x-kubernetes-int-or-string: true
                          description: Specifies the minimal amount of resources that
                            will be recommended for the container. The default is
                            no minimum.
                          type: object
                        mode:
                          description: Whether autoscaler is enabled for the container.
                          enum:
                          - Auto
                          - "Off"
                          type: string
                          x-doc-default: 'Auto'
                      type: object
                    type: array
                type: object
              targetRef:
                description: |
                  Refers to a Kubernetes controller object responsible for managing pods.

                  All common controller types are supported: `Deployment`, `StatefulSet`, `DaemonSet`, `CronJobs`, and any custom types with a scale sub-resource.
                properties:
                  apiVersion:
                    description: API version of the object.
                    type: string
                  kind:
                    description: Object type.
                    type: string
                  name:
                    description: Object name.
                    type: string
                required:
                - kind
                - name
                type: object
              updatePolicy:
                description: Describes the rules on how changes are applied to the
                  pods. If not specified, all fields in the `PodUpdatePolicy` are
                  set to their default values.
                properties:
                  updateMode:
                    description: |
                      The operation mode of the VPA controller
                      - `Auto` — currently, Auto and Recreate modes do the same thing. This mode is reserved for the [Pod inplace resource update](https://github.com/kubernetes/design-proposals-archive/blob/main/autoscaling/vertical-pod-autoscaler.md#in-place-updates) in Kubernetes.
                      - `Recreate` — this mode allows VPA to modify resource requirements of the running pods (i.e., restart them during operation). This mode might result in temporary unavailability of the service (due to restart) if you have just one replica (replicas: 1). In this mode, VPA does not recreate pods that were not created by a controller.
                      - `Initial` — VPA modifies pod resources only when pods are started (but not when pods are running).
                      - `Off` — VPA does not take any action to update the resource requests for the running containers. Autoscaler calculates recomendations and stores them in the status field of the VPA object. You can browse VPA recommendations using the following command: `kubectl describe vpa <vpa-name>`.
                    enum:
                    - "Off"
                    - Initial
                    - Recreate
                    - Auto
                    x-doc-default: 'Auto'
                    type: string
                type: object
            required:
            - targetRef
            type: object
          status:
            description: Current information about the autoscaler.
            properties:
              conditions:
                description: Conditions is the set of conditions required for this
                  autoscaler to scale its target, and indicates whether or not those
                  conditions are met.
                items:
                  description: VerticalPodAutoscalerCondition describes the state
                    of a VerticalPodAutoscaler at a certain point.
                  properties:
                    lastTransitionTime:
                      description: lastTransitionTime is the last time the condition
                        transitioned from one status to another
                      format: date-time
                      type: string
                    message:
                      description: message is a human-readable explanation containing
                        details about the transition
                      type: string
                    reason:
                      description: reason is the reason for the condition's last transition.
                      type: string
                    status:
                      description: status is the status of the condition (True, False,
                        Unknown)
                      type: string
                    type:
                      description: type describes the current condition
                      type: string
                  required:
                  - status
                  - type
                  type: object
                type: array
              recommendation:
                description: The most recently computed amount of resources recommended
                  by the autoscaler for the controlled pods.
                properties:
                  containerRecommendations:
                    description: Resources recommended by the autoscaler for each
                      container.
                    items:
                      description: RecommendedContainerResources is the recommendation
                        of resources computed by autoscaler for a specific container.
                        Respects the container resource policy if present in the spec.
                        In particular the recommendation is not produced for containers
                        with `ContainerScalingMode` set to 'Off'.
                      properties:
                        containerName:
                          description: Name of the container.
                          type: string
                        lowerBound:
                          additionalProperties:
                            anyOf:
                            - type: integer
                            - type: string
                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                            x-kubernetes-int-or-string: true
                          description: Minimum recommended amount of resources. Observes
                            ContainerResourcePolicy. This amount is not guaranteed
                            to be sufficient for the application to operate in a stable
                            way, however running with less resources is likely to
                            have significant impact on performance/availability.
                          type: object
                        target:
                          additionalProperties:
                            anyOf:
                            - type: integer
                            - type: string
                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                            x-kubernetes-int-or-string: true
                          description: Recommended amount of resources. Observes ContainerResourcePolicy.
                          type: object
                        uncappedTarget:
                          additionalProperties:
                            anyOf:
                            - type: integer
                            - type: string
                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                            x-kubernetes-int-or-string: true
                          description: The most recent recommended resources target
                            computed by the autoscaler for the controlled pods, based
                            only on actual resource usage, not taking into account
                            the ContainerResourcePolicy. May differ from the Recommendation
                            if the actual resource usage causes the target to violate
                            the ContainerResourcePolicy (lower than MinAllowed or
                            higher that MaxAllowed). Used only as status indication,
                            will not affect actual resource assignment.
                          type: object
                        upperBound:
                          additionalProperties:
                            anyOf:
                            - type: integer
                            - type: string
                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                            x-kubernetes-int-or-string: true
                          description: Maximum recommended amount of resources. Observes
                            ContainerResourcePolicy. Any resources allocated beyond
                            this value are likely wasted. This value may be larger
                            than the maximum amount of application is actually capable
                            of consuming.
                          type: object
                      required:
                      - target
                      type: object
                    type: array
                type: object
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
  - name: v1beta2
    schema:
      openAPIV3Schema: *schema
    served: true
    storage: false
  - name: v1beta1
    served: false
    storage: false
    schema:
      openAPIV3Schema: *schema
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
